package com.tensquare.recruit.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.tensquare.recruit.pojo.Recruit;

import java.util.List;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
public interface RecruitDao extends JpaRepository<Recruit,String>,JpaSpecificationExecutor<Recruit>{
    //简便方式
    public List<Recruit> findTop6ByStateOrderByCreatetimeDesc(String state);   //spring-data-jpa 的优化版查询 相当于 where state=? ordery by createtime (前6个)

    public List<Recruit> findTop6ByStateNotOrderByCreatetimeDesc(String state);   //相当于 where state!=? order by createtime
 }
